package com.jiang.smartdangjian.ui.activity;

import android.net.Uri;
import android.os.Bundle;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.MediaController;
import android.widget.TextView;
import android.widget.VideoView;

import com.jiang.smartdangjian.R;

public class S1D2Activity extends BaseActivity {

    private ImageView imageView16;
    private TextView textView30;
    private TextView textView31;
    private ImageView imageView17;
    private TextView textView32;
    private ImageView imageView12;
    private TextView textView24;
    private TextView textView25;
    private ImageView imageView13;
    private TextView textView26;
    private VideoView videoView;
    private FrameLayout fl;
    private TextView textView19;
    private TextView textView20;
    private TextView textView21;
    private TextView textView22;
    private TextView textView23;
    private ImageView imageView11;
    private ImageView imageView9;
    private TextView textView10;
    private TextView textView11;
    private TextView textView12;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_s1_d2);
        initView();
    }

    private void initView() {
        imageView16 = (ImageView) findViewById(R.id.imageView16);
        textView30 = (TextView) findViewById(R.id.textView30);
        textView31 = (TextView) findViewById(R.id.textView31);
        imageView17 = (ImageView) findViewById(R.id.imageView17);
        textView32 = (TextView) findViewById(R.id.textView32);
        imageView12 = (ImageView) findViewById(R.id.imageView12);
        textView24 = (TextView) findViewById(R.id.textView24);
        textView25 = (TextView) findViewById(R.id.textView25);
        imageView13 = (ImageView) findViewById(R.id.imageView13);
        textView26 = (TextView) findViewById(R.id.textView26);
        videoView = (VideoView) findViewById(R.id.videoView);
        fl = (FrameLayout) findViewById(R.id.fl);
        textView19 = (TextView) findViewById(R.id.textView19);
        textView20 = (TextView) findViewById(R.id.textView20);
        textView21 = (TextView) findViewById(R.id.textView21);
        textView22 = (TextView) findViewById(R.id.textView22);
        textView23 = (TextView) findViewById(R.id.textView23);
        imageView11 = (ImageView) findViewById(R.id.imageView11);
        imageView9 = (ImageView) findViewById(R.id.imageView9);
        textView10 = (TextView) findViewById(R.id.textView10);
        textView11 = (TextView) findViewById(R.id.textView11);
        textView12 = (TextView) findViewById(R.id.textView12);

        MediaController controller = new MediaController(this);

        videoView.setMediaController(controller);
        controller.setAnchorView(fl);
        videoView.setOnPreparedListener(mp -> {
            videoView.start();
            controller.hide();
        });
        videoView.setVideoURI(Uri.parse("android.resource://" + getPackageName() +"/"+ R.raw.video01));
    }
}